package com.lzw.breezeNovel.webApp.controller.video;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.model.entity.query.PaginationResultQuery;
import com.lzw.breezeNovel.webApp.service.video.AnimeService;
import com.lzw.breezeNovel.webApp.vo.video.AnimeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller.video
 * @date 2025/3/18
 * @description 动漫
 */
@RestController
@RequestMapping("/app/anime")
@SuppressWarnings("all")
public class AnimeController {

    /**
     * 注入service
     */
    @Autowired
    private AnimeService animeService;

    /**
     * 获取精品动漫
     */
    @GetMapping("/getAnime")
    public Result<PaginationResultQuery<AnimeVo>> getAnime(@RequestParam Integer pageNo, @RequestParam Integer size) {
       PaginationResultQuery<AnimeVo> animeVos = animeService.getAnime(pageNo, size);
       return Result.ok(animeVos);
    }

    /**
     * 获取相关动漫
     */
    @GetMapping("/getRelatedAnime")
    public Result<List<AnimeVo>> getRelatedAnime(@RequestParam String type,@RequestParam Integer videoId) {
        List<AnimeVo> animeVos = animeService.getRelatedAnime(type, videoId);
        return Result.ok(animeVos);
    }
}
